﻿using System;
class RealRoots
{
    static void Main()
    {
        double coeffone;
        double coefftwo;
        double coeffthree;
        double discriminant;
        double rootone;
        double roottwo;
        while (true)
        {
            try
            {
                coeffone = double.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("It is not a number. Please reenter: ");
            }
        }
        while (true)
        {
            try
            {
                coefftwo = double.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("It is not a number. Please reenter: ");
            }
        }
        while (true)
        {
            try
            {
                coeffthree = double.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("It is not a number. Please reenter: ");
            }
        }
        discriminant = ((coefftwo * coefftwo) - (4 * coeffone * coeffthree));
        if (discriminant < 0)
        {
            Console.WriteLine("Discriminant {0} < 0 => there is no real roots", discriminant);
        }
        else
        {
            if (discriminant == 0)
            {
                rootone = roottwo = ((-1) * (coefftwo / (coeffone * 2)));
                Console.WriteLine("Discriminant {0} = 0, so X1 = X2 = {1}", discriminant, rootone);
            }
            else
            {
                rootone = ((((-1) * coefftwo) + Math.Sqrt((coefftwo * coefftwo) - (4 * coeffone * coeffthree))) / 2 * coeffone);
                roottwo = ((((-1) * coefftwo) - Math.Sqrt((coefftwo * coefftwo) - (4 * coeffone * coeffthree))) / 2 * coeffone);
                Console.WriteLine("Discriminant = {0} > 0, so X1 = {1:F4} and X2 = {2:F4}", discriminant, rootone, roottwo);
            }
        }
        Console.ReadLine();
    }
}

